import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class CChop$CChopGUI extends JFrame
{
  private static final long serialVersionUID = 1L;
  private JCheckBox checkBox1;
  private JLabel label1;
  private JLabel label2;
  private JLabel label3;
  private JButton button1;
  private JComboBox comboBox1;
  private JLabel label4;
  private JComboBox comboBox2;
  private JButton button2;
  private JButton button4;

  public CChop$CChopGUI(CChop paramCChop)
  {
    initComponents();
  }

  private void button4ActionPerformed(ActionEvent paramActionEvent) {
    try {
      CChop.access$002(this.this$0, false);
      CChop.access$102(this.this$0, true);
      dispose();
    } catch (Exception localException) {
      this.this$0.log("WTF?!?");
    }
  }

  private void button2ActionPerformed(ActionEvent paramActionEvent)
  {
    try {
      CChop.access$202(this.this$0, this.comboBox2.getSelectedItem().toString());
      CChop.access$302(this.this$0, this.checkBox1.isSelected());
      CChop.access$402(this.this$0, true);
      CChop.access$102(this.this$0, false);
      CChop.access$002(this.this$0, false);
      dispose();
    } catch (Exception localException) {
      this.this$0.log("WTF?!?1");
    }
  }

  private void button1ActionPerformed(ActionEvent paramActionEvent)
  {
    try {
      CChop.access$502(this.this$0, this.comboBox1.getSelectedItem().toString());
      initializeStage2Components();
    } catch (Exception localException) {
      this.this$0.log("WTF?!?2");
    }
  }

  private void initComponents()
  {
    this.label1 = new JLabel();
    this.label2 = new JLabel();
    this.label3 = new JLabel();
    this.button1 = new JButton();
    this.comboBox1 = new JComboBox();
    this.button4 = new JButton();

    setAlwaysOnTop(true);
    setDefaultCloseOperation(2);
    setFont(new Font("Dialog", 0, 16));
    setResizable(false);
    setTitle("Conderoga's Chopper");
    Container localContainer = getContentPane();
    localContainer.setLayout(null);

    this.label1.setText("Conderoga's Chopper Settings");
    this.label1.setFont(new Font("Comic Sans MS", 0, 20));
    localContainer.add(this.label1);
    this.label1.setBounds(25, 15, 315, 39);

    this.label2.setText("Version: v1.23");
    localContainer.add(this.label2);
    this.label2.setBounds(new Rectangle(new Point(25, 50), this.label2.getPreferredSize()));

    this.label3.setText("Select what you wish to chop:");
    this.label3.setFont(this.label3.getFont().deriveFont(this.label3.getFont().getSize() + 2.0F));

    localContainer.add(this.label3);
    this.label3.setBounds(new Rectangle(new Point(10, 105), this.label3.getPreferredSize()));

    this.button1.setText("Confirm and Proceed");
    this.button1.addActionListener(new CChop.CChopGUI.1(this));

    localContainer.add(this.button1);
    this.button1.setBounds(85, 145, 195, 35);

    this.comboBox1.setMaximumRowCount(6);
    localContainer.add(this.comboBox1);
    this.comboBox1.setModel(new DefaultComboBoxModel(new String[] { "Yews", "Magics", "Ivy", "Willows", "Maples", "Oaks" }));

    this.comboBox1.setBounds(205, 100, 145, 25);

    this.button4.setText("Exit");
    this.button4.addActionListener(new CChop.CChopGUI.2(this));

    localContainer.add(this.button4);
    this.button4.setBounds(0, 325, 85, 38);

    Dimension localDimension = new Dimension();
    for (int i = 0; i < localContainer.getComponentCount(); i++) {
      Rectangle localRectangle = localContainer.getComponent(i).getBounds();
      localDimension.width = Math.max(localRectangle.x + localRectangle.width, localDimension.width);

      localDimension.height = Math.max(localRectangle.y + localRectangle.height, localDimension.height);
    }

    Insets localInsets = localContainer.getInsets();
    localDimension.width += localInsets.right;
    localDimension.height += localInsets.bottom;
    localContainer.setMinimumSize(localDimension);
    localContainer.setPreferredSize(localDimension);

    pack();
    setLocationRelativeTo(getOwner());
  }

  private void initializeStage2Components()
  {
    this.checkBox1 = new JCheckBox("Take short breaks?", false);

    this.label4 = new JLabel();
    this.comboBox2 = new JComboBox();
    this.button2 = new JButton();
    this.label1 = new JLabel();
    this.label2 = new JLabel();
    this.button4 = new JButton();

    setAlwaysOnTop(true);
    setDefaultCloseOperation(2);
    setFont(new Font("Dialog", 0, 16));
    setResizable(false);
    setTitle("Conderoga's Chopper");
    Container localContainer = getContentPane();
    localContainer.setLayout(null);

    this.label1.setText("Conderoga's Chopper Settings");
    this.label1.setFont(new Font("Comic Sans MS", 0, 20));
    localContainer.add(this.label1);
    this.label1.setBounds(25, 15, 315, 39);

    this.label2.setText("Version: v1.23");
    localContainer.add(this.label2);
    this.label2.setBounds(new Rectangle(new Point(25, 50), this.label2.getPreferredSize()));

    this.label4.setText("Select where you wish to chop:");
    this.label4.setFont(this.label4.getFont().deriveFont(this.label4.getFont().getSize() + 2.0F));

    localContainer.add(this.label4);
    this.label4.setBounds(10, 210, 180, 16);

    if (CChop.access$500(this.this$0).equals("Yews")) {
      this.comboBox2.setMaximumRowCount(8);
      this.comboBox2.setModel(new DefaultComboBoxModel(new String[] { "Grand Exchange", "Edgeville", "Rimmington", "Catherby", "Seer's Village", "South Falador", "Draynor", "Tree Gnome" }));
    }
    else if (CChop.access$500(this.this$0).equals("Magics")) {
      this.comboBox2.setMaximumRowCount(3);
      this.comboBox2.setModel(new DefaultComboBoxModel(new String[] { "Seer's Village", "Sorcerer's Tower", "Mage Training Area" }));
    }
    else if (CChop.access$500(this.this$0).equals("Ivy")) {
      this.comboBox2.setMaximumRowCount(8);
      this.comboBox2.setModel(new DefaultComboBoxModel(new String[] { "Castle Wars", "Grand Exchange", "Taverly", "Yanille", "Varrock Palace", "Ardougne", "South Falador", "North Falador" }));
    }
    else if (CChop.access$500(this.this$0).equals("Willows")) {
      this.comboBox2.setMaximumRowCount(2);
      this.comboBox2.setModel(new DefaultComboBoxModel(new String[] { "Draynor", "Port Salim" }));
    }
    else if (CChop.access$500(this.this$0).equals("Maples")) {
      this.comboBox2.setMaximumRowCount(1);
      this.comboBox2.setModel(new DefaultComboBoxModel(new String[] { "Seer's Village" }));
    }
    else if (CChop.access$500(this.this$0).equals("Oaks")) {
      this.comboBox2.setMaximumRowCount(1);
      this.comboBox2.setModel(new DefaultComboBoxModel(new String[] { "Draynor" }));
    }

    localContainer.add(this.comboBox2);
    this.comboBox2.setBounds(205, 205, 145, 25);

    this.checkBox1.setText("Take short breaks?");
    localContainer.add(this.checkBox1);
    this.checkBox1.setBounds(new Rectangle(new Point(120, 250), this.checkBox1.getPreferredSize()));

    this.button2.setText("Start");
    this.button2.addActionListener(new CChop.CChopGUI.3(this));

    localContainer.add(this.button2);
    this.button2.setBounds(175, 325, 175, 38);

    this.button4.setText("Exit");
    this.button4.addActionListener(new CChop.CChopGUI.4(this));

    localContainer.add(this.button4);
    this.button4.setBounds(0, 325, 85, 38);

    Dimension localDimension = new Dimension();
    for (int i = 0; i < localContainer.getComponentCount(); i++) {
      Rectangle localRectangle = localContainer.getComponent(i).getBounds();
      localDimension.width = Math.max(localRectangle.x + localRectangle.width, localDimension.width);

      localDimension.height = Math.max(localRectangle.y + localRectangle.height, localDimension.height);
    }

    Insets localInsets = localContainer.getInsets();
    localDimension.width += localInsets.right;
    localDimension.height += localInsets.bottom;
    localContainer.setMinimumSize(localDimension);
    localContainer.setPreferredSize(localDimension);

    pack();
    setLocationRelativeTo(getOwner());
  }
}